﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="frmIdioma.aspx.cs" Inherits="Sinacor.Tools.Web.ConstantesErro.frmIdioma" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Cadastro de Idiomas</title>
    <link href="Estilos.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="pragma" content="no-cache" />   
    
    <script type="text/javascript">
        function setUpdateItem(pObjTR)
        {
            document.getElementById('txtCodigo').value = pObjTR.childNodes[0].innerText;
            document.getElementById('hdnCodigo').value = pObjTR.childNodes[0].innerText;
            document.getElementById('txtDescricao').value = pObjTR.childNodes[1].innerText;
            document.getElementById('txtSigla').value = pObjTR.childNodes[2].innerText;;
        
        }
        
        function resetarForm()
        {
            document.getElementById('txtCodigo').value = '';
            document.getElementById('txtDescricao').value = '';
            document.getElementById('hdnCodigo').value = '';
            document.getElementById('txtSigla').value = '';
            
        }
    </script>
</head>
<body>
    <form id="frmIdioma" runat="server">
        <table style="width: 100%; height: 100%;" cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td style="width: 100%; height: 100%;">
                    <fieldset>
                        <legend><asp:Label ID="Label1" runat="server">Inclusão/Alteração de Tipo de Mensagem</asp:Label></legend>
                        <table style="width: 100%; height: 100%;" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td style="width: 10%;" align="center">Código</td>
                                <td style="width: 10%;">&nbsp;<asp:TextBox ID="txtCodigo" runat="server" Enabled="false"></asp:TextBox><input id="hdnCodigo" type="hidden" runat="server" /></td>
                                <td style="width: 10%;" align="center">Nome Idioma</td>
                                <td style="width: 20%;">&nbsp;<asp:TextBox ID="txtDescricao" runat="server" Width="50%"></asp:TextBox></td>
                                <td style="width: 5%;" align="center">&nbsp;Sigla</td>
                                <td style="width: 15%;">&nbsp;<asp:TextBox ID="txtSigla" runat="server" Width="50%"></asp:TextBox></td>
                                <td style="width: 10%;" >&nbsp;</td>
                                <td style="width: 5%;" align="center"><asp:Button ID="btnPesquisar" runat="server" 
                                        Text="Pesquisar" onclick="btnPesquisar_Click" /></td>
                                <td style="width: 5%;" align="center" ><asp:Button ID="btnSalvar" runat="server" Text="Salvar" onclick="btnSalvar_Click" style="height: 26px" /></td>
                                <td style="width: 5%;" align="center" ><input type="button" value="Novo" onclick="resetarForm();"/></td>
                            </tr>
                        </table>
                    </fieldset>
                </td>
            </tr>
            <tr>
                <td style="width: 100%; height: 100%;">
                    <fieldset>
                        <legend>Dados Cadastrados</legend>
                        <asp:GridView ID="grdTipoMensagem" runat="server" AutoGenerateColumns="False" 
                            Width="100%" AllowPaging="True" AllowSorting="True" 
                            onpageindexchanging="grdTipoMensagem_PageIndexChanging" 
                            onsorting="grdTipoMensagem_Sorting" 
                            onrowdatabound="grdTipoMensagem_RowDataBound" BorderColor="Black">
                            <Columns>
                                <asp:BoundField DataField="Id" HeaderText="Código" SortExpression="Id" >
                                    <HeaderStyle Width="10%" />
                                    <ItemStyle Width="10%" />
                                </asp:BoundField>
                                <asp:BoundField DataField="Descricao" HeaderText="Nome Idioma" SortExpression="Descricao" >
                                    <HeaderStyle Width="60%" />
                                    <ItemStyle Width="60%" />
                                </asp:BoundField>
                                <asp:BoundField DataField="Sigla" HeaderText="Sigla" SortExpression="Descricao" >
                                    <HeaderStyle Width="20%" />
                                    <ItemStyle Width="20%" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="Deletar">
                                    <ItemTemplate><asp:ImageButton runat="server" ID="Deletar" 
                                            ImageUrl="~/Imagens/delete.gif" onclick="Deletar_Click" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "Id")%>' />
                                    </ItemTemplate>
                                    <HeaderStyle Width="10%" />
                                    <ItemStyle Width="10%" />
                                </asp:TemplateField>
                            </Columns>
                            <PagerStyle BackColor="#F0F0F0" />
                            <HeaderStyle BackColor="#F0F0F0" />
                        </asp:GridView>
                    </fieldset>
                </td>
            </tr>
            <tr>
                <td style="width: 100%; height: 100%;">&nbsp;</td>
            </tr>        
        </table>
    </form>
</body>
</html>
